import {createRouter, createWebHistory} from 'vue-router'
import Layout from "@/layout/Index.vue";

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/admin/login',
            component: () => import('@/views/login/adminLogin/index.vue')
        },
        {
            path: '/admin',
            component: Layout,
            children: [
                {
                    path: 'dashboard',
                    component: () => import('@/views/home/index.vue')
                },
                {
                    path: 'manage',
                    component: () => import('@/views/adminmanage/index.vue')
                },
                {
                    path: 'apidocument',
                    component: ()=> import('@/views/adminmanage/ApiDocument.vue')
                }
            ]
        },
        {
            path: '/business/login',
            component: () => import('@/views/login/businessLogin/index.vue')
        },
        {
            path: '/business',
            component: Layout,
            children: [
                {
                    path: 'goods/type',
                    component: () => import('@/views/businessmanage/GoodsTypeManage.vue')
                },
                {
                    path: 'goods/manage',
                    component: () => import('@/views/businessmanage/GoodsManage.vue')
                },
                {
                    path: 'order/manage',
                    component: () => import('@/views/businessmanage/OrderManage.vue')
                }
            ]
        },
        {
            path: '/',
            component: () => import('@/views/home/index.vue')
        }
    ]
})

export default router
